import React, { Component } from 'react'

/*
    children 属性： 表示组件的子节点，只要组件内部有子节点，props中就有该属性
    children 可以是什么
        普通文本、标签元素、函数、jsx
*/


function List(props) {
    console.log(props.children)
    return (
        <div>
            {/* {props.children} */}
            {/* {props.children[0]}
            {props.children[1]} */}
            {props.children.map(child => child)}
        </div>
    )
}



export default class Test8_com_children extends Component {
  render() {
    return (
      <div>
        <List>
            this is text
            <div style={{color: 'red'}}>this is child</div>
            {/* {() => console.log(123)} */}
            <p>this is p</p>
        </List>
      </div>
    )
  }
}
